from django.contrib import admin
from hospitals.models import HospitalModel, DepartmentModel, IllnessModel


# class HospitalInLine(admin.TabularInline):
#     model = DepartmentModel
#     fields = ['id', 'name']


class HospitalModelAdmin(admin.ModelAdmin):
    list_display = ['id', 'name', 'tel', 'address', 'level', 'cover_small']
    ordering = ['id']
    search_fields = ['name']
    # inlines = [HospitalInLine]


admin.site.register(HospitalModel, HospitalModelAdmin)


class DepartmentModelAdmin(admin.ModelAdmin):
    list_display = ['id', 'name', 'direction', 'cover_small']
    ordering = ['id']
    search_fields = ['name']


admin.site.register(DepartmentModel, DepartmentModelAdmin)


class IllnessModelAdmin(admin.ModelAdmin):
    list_display = ['id', 'name', 'department']
    ordering = ['id']
    search_fields = ['name']


admin.site.register(IllnessModel, IllnessModelAdmin)
